package sketch.ounit.fuzz;

/**
 * This class is only for testing purpose
 * */
public class ExceptionThrowingCode {

	private boolean flag = false;
	
	public void openFlag() {
		flag = true;
	}

	public void closeFlag() {
		flag = false;
	}
	
	public void mayThrowException() {
		if(!flag) {
			throw new RuntimeException("flag should be setted");
		} else {
			System.out.println("Aha, you are lucky, avoid getting an exception");
		}
	}
	
	public void doAnotherThing() {
		if(flag) {
			throw new RuntimeException("Flag should not be setted");
		} else {
			System.out.println("Uhh, you are lucky, avoid getting an exception");
		}
	}
}